package com.hdey.service.chao.impl;

import com.alibaba.druid.util.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hdey.mapper.chao.ChukuMapper;
import com.hdey.pojo.chao.Chuku;
import com.hdey.service.chao.ChukuService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service("ChukuService")
@Transactional
public class ChukuServiceImpl extends ServiceImpl<ChukuMapper, Chuku> implements ChukuService {

    @Resource
    private ChukuMapper chukuMapper;


    @Override
    public Page<Chuku> searchPage(Integer current, Integer size, String outstorageMasterNo) {
        Page<Chuku> page=new Page<>(current,size);
        LambdaQueryWrapper<Chuku> wrapper=new LambdaQueryWrapper<>();
        wrapper.like(!StringUtils.isEmpty(outstorageMasterNo), Chuku::getOutstorageMasterNo,outstorageMasterNo);
        //wrapper.eq(wuzi.getDictionaryId()!=null,Wuzi::getDictionaryId,wuzi.getDictionaryId());
        chukuMapper.selectPage(page,wrapper);
        return page;
    }

    /*@Override
    public void chukuUpdate(Integer outstorageMasterId) {
        chukuMapper.chukuUpdate(outstorageMasterId);
    }*/


}
